fix(cli): delegate happy update/upgrade to claude - #1727
Open
charliezong18 wants to merge 1 commit into
Open
Conversation
Neither alias was in the subcommand chain, so both fell through to the session launcher, which appends Happy's hook --settings — an option claude's update command rejects, so it always failed. Resolves the claude binary directly rather than going through claude_local_launcher.cjs, whose DISABLE_AUTOUPDATER=1 and fetch interception have no business in a one-shot update. Fixes slopus#1529
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Neither
updatenorupgradeis in the subcommand chain, so both fall through to the session launcher, which appends Happy's hook--settings— an optionclaude's update command rejects. That is the failure #1529 reports.Route both aliases straight to
claude, propagating exit status and signals.Why not reuse
claudeCliPath(as the--helppath at index.ts:798 does): that constant points atscripts/claude_local_launcher.cjs, which setsDISABLE_AUTOUPDATER = '1'(line 4) and replacesglobal.fetchto report progress over fd 3 (lines 16-19). Running the updater through a launcher that disables the auto-updater is not what anyone wants, so this branch resolves the claude binary itself.Fixes #1529
Proof
Isolated
HAPPY_HOME_DIR, andHAPPY_CLAUDE_PATHpointed at a stub that prints its argv and exits with a chosen code — so the real claude is never invoked.Before —
main,happy update: never reaches claude at all;updateis treated as a session launch.After — this branch:
No
--settings, alias and trailing flags pass through. Exit status propagates — with the stub exiting 7,happyexits 7.Validation
happy-clitypecheck: no new errors relative tomainpackages/happy-cli/src/index.tsindex.tshas not been modified upstream since this fix was written🤖 Generated with Claude Code